<div ng-controller="useStaticsCtrl">
    <div class="x_panel" >
        <div class="form-inline">
            <div class="form-group">
                <label>发卡日期</label>
                <input type="text" class="form-control Wdate"  ng-model="search.fromDate"  placeholder="开始日期" onchange=""
                       onclick="javascript:WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:&quot;#F{$('.Wdate').last().val()||'%y-%M-%d'}&quot;})">
                <label>-</label>
                <input type="text" class="form-control Wdate"  ng-model="search.toDate"  placeholder="结束日期" onchange=""
                       onclick="javascript:WdatePicker({dateFmt:'yyyy-MM-dd',minDate:&quot;#F{$('.Wdate').first().val()}&quot;,maxDate:'%y-%M-%d'})">
            </div>
            <div class="form-group">
                <label>发放渠道 </label>
                <select class="form-control" ng-model="search.channel"
                        ng-options="o.id as o.val for o in $root.channel">
                    <option value="">--请选择--</option>
                </select>
                <label>卡券类型 </label>
                <select class="form-control" ng-model="search.cardType"
                        ng-options="o.id as o.val for o in $root.cardType">
                    <option value="">--请选择--</option>
                </select>
            </div>
            <button class="btn btn-primary" ng-click="find(1)" >查询</button>
            <button class="btn btn-default" ng-click="search={}" >重置</button>
        </div>
    </div>
    <table class="table table-bordered table-striped table-hover" >
        <thead class="title">
        <tr>
            <th class="text-center">NO</th>
            <th>总发卡数目</th>
            <th>总发卡金额</th>
            <th>实际发卡金额</th>
            <th>总使用金额</th>

            <th>实际使用金额</th>
            <th>退保数目</th>



            <th>发卡使用率</th>
            <th>退保金额</th>
            <th>损耗</th>
            <th>实际退保金额</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-if="pageModel.data.length == 0">
            <td colspan="100" class="text-center">暂无记录</td>
        </tr>
        <tr ng-repeat="item in pageModel.data">
            <td class="text-center">{{$index + 1+pageModel.pageSize*pageModel.pageIndex}}</td>
            <td>{{item.cardNum}}</td>
            <td>{{item.faceValueTotal}}</td>
            <td>{{(item.faceValueTotal - item.cancelTotal)|currency}}</td>
            <td>{{item.consumptionTotal|currency}}</td>

            <td>{{item.consumptionTotal-item.cancelConsumptionTotal|currency}}</td>
            <td>{{item.cancelNum}}</td>

          <!--  <td>{{item.cardNum-item.cancelNum}}</td>-->

            <td><span ng-if="item.cardNum">{{(item.consumptionTotal)*100/(item.faceValueTotal - item.cancelTotal+item.cancelConsumptionTotal)|number:2}}%</span></td>
            <td>{{item.cancelTotal|currency}}</td>
            <td>{{item.cancelConsumptionTotal|currency}}</td>
            <td>{{ (item.cancelTotal - item.cancelConsumptionTotal)|currency}}</td>
        </tr>
        </tbody>
    </table>
    <div class="page-footer clearfix" >
        <page page-model="pageModel"></page>
    </div>
</div>